
#[path="./command_init.rs"]
mod command_init;
#[path="./command_sync.rs"]
mod command_sync;

use crate::command_parser;


pub fn do_action(command: command_parser::Commands) {
    match command {
        command_parser::Commands::Init(param) => {
            println!("got init subcommand, manifest url({:?}), brance({:?})",param.url, param.branch);
            let _ = command_init::do_init(command_parser::CommandInit { url: param.url, branch: param.branch });
            //let _ = DoSync((url, branch));
        }
        command_parser::Commands::Sync(param) => {
            let _ = command_sync::do_sync(command_parser::CommandSync { url: param.url, branch: param.branch });
        }

        _ => {
            println!("non-exhaustive patterns");
        }
    }
}